/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved.
 */
package com.kaaction.modules.operate.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaaction.common.service.TreeService;
import com.kaaction.common.utils.StringUtils;
import com.kaaction.modules.operate.entity.Channel;
import com.kaaction.modules.operate.dao.ChannelDao;

/**
 * 渠道Service
 * @author zengbiao
 * @version 2017-04-12
 */
@Service
@Transactional(readOnly = true)
public class ChannelService extends TreeService<ChannelDao, Channel> {

	public Channel get(String id) {
		return super.get(id);
	}
	
	public List<Channel> findList(Channel channel) {
		if (StringUtils.isNotBlank(channel.getParentIds())){
			channel.setParentIds(","+channel.getParentIds()+",");
		}
		return super.findList(channel);
	}
	
	@Transactional(readOnly = false)
	public void save(Channel channel) {
		super.save(channel);
	}
	
	@Transactional(readOnly = false)
	public void delete(Channel channel) {
		super.delete(channel);
	}
	
}